package cn.edu.nit.sys.controller;

import cn.edu.nit.sys.config.OperationAnnotation;
import cn.edu.nit.sys.entity.SysLog;
import cn.edu.nit.sys.service.SysLogService;
import cn.edu.nit.sys.utils.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xiaobai
 * @Date 2022/9/7 22:52
 * @Version 1.0.0
 */
@RestController
@RequestMapping("/log")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    @GetMapping
//    @PreAuthorize("hasAuthority('ADMIN')")
    @OperationAnnotation(description = "获取系统操作日志", opType = "查询")
    public R getList(Page<SysLog> page) {
        return sysLogService.getList(page);
    }
}
